home *** CD-ROM | disk | FTP | other *** search
-
-
-
- VFORK(3) MINTLIB LIBRARY FUNCTIONS VFORK(3)
-
-
- N✓NA✓AM✓ME✓E
- vfork - spawn new process in a memory efficient way
-
- S✓SY✓YN✓NO✓OP✓PS✓SI✓IS✓S
- #include <unistd.h>
-
- int vfork(void);
-
- D✓DE✓ES✓SC✓CR✓RI✓IP✓PT✓TI✓IO✓ON✓N
- vfork can be used to create new processes without fully
- copying the address space of the parent process, which is
- unnecessary in many cases. It is useful when the only pur-
- pose of fork would have been to create a new process just
- in order to do an exec.. call. vfork differs from fork in
- that the child borrows the parent's memory and thread of
- control until a call to exec.., or an exit (either by a
- call to _exit or abnormally). The parent process is sus-
- pended while the child is using its resources.
-
- vfork returns zero to the child and (later) the process ID
- of the child to the parent.
-
- S✓SE✓EE✓E A✓AL✓LS✓SO✓O
- e✓ex✓xe✓ec✓c.✓..✓.(✓(3✓3)✓),✓, f✓fo✓or✓rk✓k(✓(3✓3)✓),✓, t✓tf✓fo✓or✓rk✓k(✓(3✓3)✓),✓, w✓wa✓ai✓it✓t(✓(3✓3)✓)
-
- N✓NO✓OT✓TE✓ES✓S
- The child should never return from the procedure that
- called vfork, since that will mess up the stack frame for
- the parent on its return from vfork.
-
- The vfork call is not available in UN*X System V.3. It
- will disappear from SunOS in the future (in fact, it would
- have disappeared if it weren't for the program mentioned
- below). So, if you want to write portable code, fork,
- don't vfork.
-
- Changes the child makes to the parents' variables will
- have effect on the parent. Do not rely on this, since it
- is a disgusting habit. (Presumably, this is why the Berke-
- ley C-Shell has been implemented this way.)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- MiNT docs 0.1 3 March 1993 1
-
-
-